package Example.Connectors;

import java.util.HashMap;
import java.util.Map;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.BindingController;
import org.objectweb.fractal.api.control.IllegalBindingException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import java.util.Date;import java.util.Vector;
import Example.Interfaces.BikeOprs;
public class BikeOprsCtr implements BikeOprs, BindingController{

private Object service;
private Map bindings = new HashMap();

public String[] listFc () {
return (String[])bindings.keySet().toArray(new String[bindings.size()]);
}

public Object lookupFc (String itf) {
return bindings.get(itf);
}

public void bindFc (String itf, Object value) {
if (!itf.equals("component")) {
bindings.put(itf, value);
}
}

public void unbindFc(String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
System.err.println("unbind");
if(!(bindings.get(clientItfName)==null))
bindings.remove(clientItfName);
}
public Vector selectBike(String a1,String a2){
return ((BikeOprs) service).selectBike( a1, a2);
}

public boolean rentBike(int a1,int a2){
return ((BikeOprs) service).rentBike( a1, a2);
}

public boolean returnBike(int a1,String a2,double a3){
return ((BikeOprs) service).returnBike( a1, a2, a3);
}

}
